/* Copyright 2010 by Matt Van Der Westhuizen */

package org.chaoticengine.ast.model;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author Matt Van Der Westhuizen <mattpwest@gmail.com>
 */
public class AirShipFactory {
    protected static AirShipFactory instance = null;
    protected ArrayList<AirShip> ships = null;

    private AirShipFactory() {
        ships = new ArrayList<AirShip>();
    }

    public static AirShipFactory getInstance() {
        if (instance == null) {
            instance = new AirShipFactory();
        }

        return(instance);
    }

    public AirShip createShip(String name, ShipLocation loc) {
        AirShip as = new AirShip();
        as.setName(name);
        as.setLocation(loc);

        ships.add(as);

        return(as);
    }

    public List<AirShip> getShips() {
        return(ships);
    }
}
